g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+ if (GDK_WINDOW_DESTROYED (window))
+ {
+ if (x)
+ *x = 0;
+ if (y)
+ *y = 0;
+ return 0;
+ }
+
private = (GdkWindowObject *) window;
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_root_coords (window,
* window coordinates. This is similar to
* gdk_window_get_origin() but allows you go pass
* in any position in the window, not just the origin.
- *
- * Return value: not meaningful, ignore
*/
-gint
+void
gdk_window_get_root_coords (GdkWindow *window,
gint x,
gint y,
private = (GdkWindowObject *) window;
+ if (GDK_WINDOW_DESTROYED (window))
+ {
+ if (x)
+ *root_x = x;
+ if (y)
+ *root_y = y;
+ return;
+ }
+
GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_root_coords (window,
x + private->abs_x,
y + private->abs_y,
gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
-gint gdk_window_get_root_coords (GdkWindow *window,
+void gdk_window_get_root_coords (GdkWindow *window,
gint x,
gint y,
gint *root_x,
{
gint return_val;
Window child;
- gint tx = 0;
- gint ty = 0;
+ gint tx;
+ gint ty;
- if (!GDK_WINDOW_DESTROYED (window))
- {
- return_val = XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- GDK_WINDOW_XROOTWIN (window),
- x, y, &tx, &ty,
- &child);
- }
- else
- return_val = 0;
+ return_val = XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window),
+ GDK_WINDOW_XROOTWIN (window),
+ x, y, &tx, &ty,
+ &child);
if (root_x)
*root_x = tx;